#!/usr/bin/env bash

set -e

echo "-- chart/package --"

cd $(dirname $0)/..
. ./version

mkdir -p ../bin/chart/${CHART_REPO}

helm package -d ../bin/chart/${CHART_REPO} ../build/chart/rancher

if [[ "${CHART_REPO}" == "dev" ]]; then
    echo "dev repo - skipping index"
else
    echo "updating index ... "
    ./chart/index ${CHART_REPO}
fi
